﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Pricecheckup
/// </summary>
/// 
namespace Bestlife.ERP.DataAccess
{
    public class Pricecheckup
    {
        public Pricecheckup()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public string returnPrice(string price) 
        {
                string Price1 = "0";
                string Price2 = "00";                                
                                             
 	            string pricecm = price;
                string[] arr = pricecm.Split('.');
                int ee=arr.Length;

                if (arr.Length < 2)
                {
                    Price1 = arr[0].ToString();
                    Price2 = "00";
                }
                else
                {
                    Price1 = arr[0].ToString();
                    Price2 = arr[1].ToString();
                   // int priceT=int.Parse(Price2);

                    long p2 = long.Parse(Price2);

                    if ((Price2.Equals("01")) || (Price2.Equals("02")) || (Price2.Equals("03")) || (Price2.Equals("04")) || (Price2.Equals("05")) || (Price2.Equals("06")) || (Price2.Equals("07")) || (Price2.Equals("08")) || (Price2.Equals("09")))
                    {
                        
                    }
                    else 
                    {

                        if (p2 < 10)
                        {

                            Price2 = p2 + "0";

                        }
                    }
                }
                return Price1 + "." + Price2;
        }

    }
}